﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChannelVN.CMS.Common;

namespace ChannelVN.CMS.DynamicLayout.FrontEnd.Common
{
    public class PostDataFromAdmin
    {
        private const string QueryStringNameForSecretKey = "DynamicLayoutSecretKey";
        private const string QueryStringNameForAction = "DynamicLayoutAction";
        private const string QueryStringNameForPageDetail = "DynamicLayoutPageDetail";
        private const string QueryStringNameForControlDetail = "DynamicLayoutControlDetail";

        public static string SecretKey
        {
            get { return GetQueryString.GetPost(QueryStringNameForSecretKey, ""); }
        }

        public static bool IsLoadPageAction
        {
            get { return GetQueryString.GetPost(QueryStringNameForAction, "") == "loadpage"; }
        }
        public static bool IsPreviewAction
        {
            get { return GetQueryString.GetPost(QueryStringNameForAction, "") == "preview"; }
        }
        public static bool IsPublishPageAction
        {
            get { return GetQueryString.GetPost(QueryStringNameForAction, "") == "publishpage"; }
        }

        public static bool IsLoadControlAction
        {
            get { return GetQueryString.GetPost(QueryStringNameForAction, "") == "loadcontrol"; }
        }
        public static bool IsLoadConfigAction
        {
            get { return GetQueryString.GetPost(QueryStringNameForAction, "") == "loadconfig"; }
        }

        public static string PageDetail
        {
            get { return GetQueryString.GetPost(QueryStringNameForPageDetail, ""); }
        }

        public static string ControlDetail
        {
            get { return GetQueryString.GetPost(QueryStringNameForControlDetail, ""); }
        }
    }
}
